package com.me.collector.items;

import java.util.ArrayList;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.physics.box2d.CircleShape;
import com.badlogic.gdx.physics.box2d.PolygonShape;
import com.badlogic.gdx.physics.box2d.Shape;
import com.me.collector.Definitions;
import com.me.collector.Definitions.ItemType;
import com.me.collector.FallingItems;
import com.me.collector.FallingObject;
import com.me.collector.FallingObjectList;
import com.me.collector.Hero;
import com.me.collector.Item;

public class Cherry extends Item {
	public Cherry()
	{
		super("items/cherry.png", 32, 32, 100);
	}

	@Override
	public ArrayList<Shape> createShapes() {
		ArrayList<Shape> shapes = new ArrayList<Shape>();
		// Two circle Shapes and a triangle
		CircleShape c1 = new CircleShape();
		c1.setRadius(6 * Definitions.WORLD_TO_BOX);
		c1.setPosition(new Vector2(24 * Definitions.WORLD_TO_BOX,
				8 * Definitions.WORLD_TO_BOX));

		CircleShape c2 = new CircleShape();
		c2.setRadius(7 * Definitions.WORLD_TO_BOX);
		c2.setPosition(new Vector2(7 * Definitions.WORLD_TO_BOX,
				8 * Definitions.WORLD_TO_BOX));

		// triangle
		PolygonShape p1 = new PolygonShape();
		Vector2[] polygons = new Vector2[] {
				new Vector2(26 * Definitions.WORLD_TO_BOX,
						16 * Definitions.WORLD_TO_BOX),
				new Vector2(20 * Definitions.WORLD_TO_BOX,
						30 * Definitions.WORLD_TO_BOX),
				new Vector2(6 * Definitions.WORLD_TO_BOX,
						15 * Definitions.WORLD_TO_BOX) };
		p1.set(polygons);

		shapes.add(c2);
		shapes.add(p1);
		shapes.add(c1);

		return shapes;
	}

	@Override
	public void effect(Hero hero, FallingObject o, FallingItems fItems) {
		// TODO Auto-generated method stub
		hero.getContainer().AddItem(this);
		o.remove();
	}

	@Override
	public ItemType getType() {
		// TODO Auto-generated method stub
		return ItemType.cherry;
	}
	
}
